<template>
    <view class="flex-start-center tabs-Email-content" v-for="item in PropsData.data" :key="item.c_guid" @click="onClickEmail(item)">
        <view class="left">
            <span class="point" v-show="item.c_read_status=='否' || item.c_read_status=='N' "></span>
            <image :src="item.url" mode="scaleToFill" class="image"  @error="imageError(item)" />
        </view>
        <view class="right flex-column-between">
            <view class="flex-start-center">
                <view class="text-ellipsis sub_title flex_1">{{ item.c_title }}</view>
                <view class="text-ellipsis tertiary_des">{{ item.c_send_dt }}</view>
            </view>
            <!-- <view class="text-ellipsis sub_des">{{item.littleTitle}}</view> -->
            <view class="text-ellipsis sub_des">发件人：{{item.c_sender_name}}</view>
        </view>
    </view>
    <view v-if="PropsData.data.length == 0" class="no-data">
        <image src="@/static/img/no_data.png" mode="aspectFit" class="image" />
    </view>
</template>
<script setup lang="ts">
import { ref, defineProps } from 'vue';
import service from '@/common/service'
import { useLoginStore } from '@/store/modules/useLoginStore';
import { useMainStore } from '@/store/modules/store';
const LoginStore = useLoginStore();
const mainStore = useMainStore();
/**
 *  TabsEmail 收件箱
 * @property {Array} data = 数据列表
 */

 let PropsData = defineProps(['data']) 
 const onClickEmail = (item) => {
    uni.navigateTo({
        url: '/pages/OaViews/Email/EmailDetail?id=' + item.c_id + '&selType=收件箱' + '&industryTabIndex=2&c_read_status='+item.c_read_status
    });
 
}

const imageError = (item) => {
    item.url = '../../../static/img/avatar_male.png';
};
</script>

<style lang="scss" scoped>
.tabs-Email-content {
    margin-top: 14px;
    margin-bottom: 20px;
}
.left {
    position: relative;
    width: 72rpx;
    height: 72rpx;
    .point {
        position: absolute;
        top: 2px;
        right: 1px;
    }   
    .image {
        width: 100%;
        height: 100%;
        border-radius: 50%;
    }
}
.right {
    flex: 1;
    width: 0;
    height: 80rpx;
    margin-left: 20rpx;
}

</style>